﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace GoDinner.Controllers
{
    public class HomeController : Controller
    {

        Models.GoDinnerDbContext _db = new Models.GoDinnerDbContext();

        
        public ActionResult Index()
        {
            ViewBag.Message = "Index";
            
            return View();
        }
               
        public ActionResult OverOns()
        {
            ViewBag.Message = "Over GoDinner";

            return View();
        }

        [Authorize]
        public ActionResult Reserveren()
        {
            ViewBag.Message = "Reserveren";

            var model = _db.GerechtTypes.ToList();

            for (int i = 0; i < model.Count; i++)
            {
                Console.WriteLine(model);
            }

            return View(model);
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Contact";

            return View();
        }


        public ActionResult Menukaart()
        {
            //ViewBag.Message = "Menukaart
            var model = _db.GerechtTypes.ToList();

            for (int i = 0; i < model.Count ; i++)
            {
                Console.WriteLine(model);
            }

            return View(model);
        }

        public ActionResult Info()
        {
            return PartialView("_Info");
        }

        protected override void Dispose(bool disposing)
        {
            if (_db != null)
            {
                _db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
